﻿Imports System
Imports System.ServiceModel.Channels
Imports System.ServiceModel.Description
Imports System.ServiceModel.Dispatcher

Namespace Services.Amazon
    Public Class AmazonSigningEndpointBehavior
        Implements IEndpointBehavior
        Private accessKeyId As String = ""
        Private secretKey As String = ""

        Public Sub New(ByVal accessKeyId As String, ByVal secretKey As String)
            Me.accessKeyId = accessKeyId
            Me.secretKey = secretKey
        End Sub

        Public Sub ApplyClientBehavior(ByVal serviceEndpoint As ServiceEndpoint, ByVal clientRuntime As ClientRuntime) Implements IEndpointBehavior.ApplyClientBehavior
            clientRuntime.MessageInspectors.Add(New AmazonSigningMessageInspector(accessKeyId, secretKey))
        End Sub

        Public Sub ApplyDispatchBehavior(ByVal serviceEndpoint As ServiceEndpoint, ByVal endpointDispatcher As EndpointDispatcher) Implements IEndpointBehavior.ApplyDispatchBehavior
            Return
        End Sub
        Public Sub Validate(ByVal serviceEndpoint As ServiceEndpoint) Implements IEndpointBehavior.Validate
            Return
        End Sub
        Public Sub AddBindingParameters(ByVal serviceEndpoint As ServiceEndpoint, ByVal bindingParameters As BindingParameterCollection) Implements IEndpointBehavior.AddBindingParameters
            Return
        End Sub
    End Class
End Namespace
